<!-- Practice_StudentReport_Win.html -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>报告win</title>
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
	</head>
	<style>
		body {
		}
		.icon_right {
			height: 20px;
			position: absolute;
			top: 50%;
			right: 15px;
			/* left: 15px; */
			margin-top: -11px;
		}
	</style>
	<body>
		<div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar">
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span>报告</span>
			<a class="base_left_item" href="#" onclick="addReport()" style="float: right"> <img class="icon_right" src="../../image/icon_discuss_add.png" alt=""> </a>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	- <script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/common.js"></script>
	<script type="text/javascript">
	    var pid = '';
		apiready = function() {
		   	sendBuriedNotifi('0', '学生端报告', '246');
		   	judgePracticeType();
			setupFrame();
			closewin();
		}
		function setupFrame() {
			var y = $('#BarAppearance').height() + $('.base_navigation_bar').height();
			var h = api.winHeight - y;
			api.openFrame({
				name : 'Practice_StudentReport_Frame',
				url : 'Practice_StudentReport_Frame.html',
				rect : {
					x : 0,
					y : y,
					w : 'auto',
					h : h
				},
				allowEdit : true,
				pageParam : {
					sourceurl : window.location.pathname,
					sourcetitle : document.title
				},
				bounces : false,
				bgColor : '#fff'
			});
		}

		function backClick() {
			api.closeWin();
			sendBuriedNotifi('1', '学生端报告', '246');
		}

		function closewin() {
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				backClick();
			})
		}

		function addReport() {
			if (pid.length == 0) {
				ShowToast('你还未有实习计划，不可提交实习报告');
				return;
			}
			var sourceurl = window.location.pathname;
			var sourcetitle = document.title;
			var DataParam = {
				sourceurl : sourceurl,
				sourcetitle : sourcetitle
			};
			api.openWin({useWKWebView:true,
				name : 'Student_completionReportWindow',
				url : '../TrainReport/Student_completionReportWindow.html',
				pageParam : DataParam,
				allowEdit : true
			});
		}
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		//学生端获取实习计划状态（仅限学生端）
		function judgePracticeType() {
			var param = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid')
			};
			cfnetppPOST(urlPracticeType, param, true, function(data, status) {
				if (status == 'success') {
					//1,成功，返回success
					if (data.status == 1) {
						var list = data.json;
						if (list != null && list != '') {
//							$("#main").show();
//							sxtypes = parseInt(list.sxtypes);
							pid = list.id;
						} else {
//							$("#main").hide();
//							ShowToast('你还未有实习计划，请等待分配');
						}
					} else if (data.status == -1) {
//						$("#main").hide();
//						ShowToast('你还未有实习计划，请等待分配');
					} else {
//						$("#main").hide();
//						ShowToast('你还未有实习计划，请等待分配');
					}
				}
			})
		}

	</script>
</html>